//
//  j3RenderingEngine1.h
//  HJC3D
//
//  Created by HJC on 11-10-10.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#ifndef _J3RENDERINGENGINE1_H_
#define _J3RENDERINGENGINE1_H_



#include "j3RenderingEngine.h"
#include <OpenGLES/ES1/gl.h>
#include <OpenGLES/ES1/glext.h>
#include <vector>


extern j3RenderingEngine* CreateRenderer1();



class j3RenderingEngine1 : public j3RenderingEngine 
{
public:
    j3RenderingEngine1();
    void initialize(int width, int height);
    void render() const;
    void updateAnimation(float timeStep);
    void onRotate(DeviceOrientation newOrientation);
    
    void onFingerUp(ivec2 location);
    void onFingerDown(ivec2 location);
    void onFingerMove(ivec2 oldLocation, ivec2 newLocation);
    
private:
    float   rotationDirection() const;
    void    initConeData();
    
    float   _desiredAngle;
    float   _currentAngle;
    
    
    std::vector<Vertex> _cone;
    std::vector<Vertex> _disk;
    Animation _animation;
    
    GLuint  _framebuffer;
    GLuint  _colorRenderbuffer;
    GLuint  _depthRenderbuffer;
};



#endif
